home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
anidone
/
art4
/
art.s
< prev
next >
Wrap
Text File
|
1995-05-02
|
5KB
|
270 lines
TEXT
INCLUDE TOS\GEMDOS.S
INCLUDE TOS\XBIOS.S
_FG_BP_1=24 ;LINE-A VARIABLES
_FG_BP_2=26
_FG_BP_3=28
_FG_BP_4=30
_LSTLIN =32
_LN_MASK=34
_WRT_MOD=36
_X1 =38
_Y1 =40
_X2 =42
_Y2 =44
SAVEA0 MACRO ;SAVE LINE-A POINTER
MOVE.L A0,SVA0
ENDM
GETA0 MACRO ;GET LINE-A POINTER
MOVE.L SVA0,A0
ENDM
AINIT MACRO ;INITIALIZE LINE-A GRAPHICS
DC.W $A000
ENDM
ACOLOR MACRO $\1,$\2,$\3,$\4 ;SET LINE-A PLANE COLORS
AND #1,\1
MOVE \1,_FG_BP_1(A0)
AND #1,\2
MOVE \2,_FG_BP_2(A0)
AND #1,\3
MOVE \3,_FG_BP_3(A0)
AND #1,\4
MOVE \4,_FG_BP_4(A0)
ENDM
AWRITEMODE MACRO $\1 ;SET LINE-A WRITE MODE
MOVE \1,_WRT_MOD(A0)
ENDM
ALINEMASK MACRO $\1 ;SET LINE-A LINE MASK
MOVE \1,_LN_MASK(A0)
ENDM
ALINE MACRO $\1,$\2,$\3,$\4 ;DRAW LINE-A LINE
MOVE \1,_X1(A0)
MOVE \2,_Y1(A0)
MOVE \3,_X2(A0)
MOVE \4,_Y2(A0)
MOVE #-1,_LSTLIN(A0)
DC.W $A003
ENDM
START:
DC.W $A00A ;HIDE MOUSE
GETREZ ;SAVE RESOLUTION
MOVE D0,REZ
SETSCREEN #0,-1,-1 ;SET LO-RES
AINIT
SAVEA0
ALINEMASK #$FFFF
AWRITEMODE #1
MOVE #10000,DLY
RESTART:
RNDX: ;RANDOM X (0-319)
RANDOM
AND #$1FF,D0
CMP #319,D0
BHI RNDX
MOVE D0,X
RNDMVX: ;RANDOM MOVE (3~-3, <>0)
RANDOM
AND #7,D0
SUB #3,D0
CMP #0,D0
BEQ RNDMVX
CMP #4,D0
BEQ RNDMVX
MOVE D0,MVX
RNDY: ;RANDOM Y (0-199)
RANDOM
AND #$FF,D0
CMP #199,D0
BHI RNDY
MOVE D0,Y
RNDMVY: ;RANDOM MOVE (3~-3, <>0)
RANDOM
AND #7,D0
SUB #3,D0
CMP #0,D0
BEQ RNDMVY
CMP #4,D0
BEQ RNDMVY
MOVE D0,MVY
RNDX2: ;RANDOM X2 (0-319)
RANDOM
AND #$1FF,D0
CMP #319,D0
BHI RNDX2
MOVE D0,X2
RNDMVX2: ;RANDOM MOVE (3~-3, <>0)
RANDOM
AND #7,D0
SUB #3,D0
CMP #0,D0
BEQ RNDMVX2
CMP #4,D0
BEQ RNDMVX2
MOVE D0,MVX2
RNDY2: ;RANDOM Y2 (0-199)
RANDOM
AND #$FF,D0
CMP #199,D0
BHI RNDY2
MOVE D0,Y2
RNDMVY2: ;RANDOM MOVE (3~-3, <>0)
RANDOM
AND #7,D0
SUB #3,D0
CMP #0,D0
BEQ RNDMVY2
CMP #4,D0
BEQ RNDMVY2
MOVE D0,MVY2
CLEARSCREEN:
PRINTLINE CLS
RNDLEN: ;GET RANDOM LENGTH
RANDOM
AND #$3F,D0
ADD #25,D0
MOVE D0,LENGTH
RNDCOL: ;GET RANDOM COLOR
RANDOM
MOVE D0,D7
RANDOM
MOVE D0,D6
RANDOM
MOVE D0,D5
RANDOM
GETA0
ACOLOR D0,D5,D6,D7
AGAIN: ;MAIN LOOP
ALINE X,Y,X2,Y2
RAWCONIO #$FF ;CHECK KEYBOARD
GETA0
CMP #'',D0
BEQ DONE ;EXIT
CMP #$0D,D0
BEQ RESTART
CMP #' ',D0
BEQ CLEARSCREEN
CMP #'1',D0
BNE P2
MOVE #10000,DLY
BRA CONTINUE
P2:
CMP #'2',D0
BNE P3
MOVE #8000,DLY
BRA CONTINUE
P3:
CMP #'3',D0
BNE P4
MOVE #6000,DLY
BRA CONTINUE
P4:
CMP #'4',D0
BNE P5
MOVE #4000,DLY
BRA CONTINUE
P5:
CMP #'5',D0
BNE P0
MOVE #2000,DLY
BRA CONTINUE
P0:
CMP #'0',D0
BNE CONTINUE
MOVE #0,DLY
CONTINUE:
MOVE LENGTH,D0 ;DECREMENT LENGTH
SUB #1,D0
MOVE D0,LENGTH
BEQ RNDLEN ;GET NEW LENGTH, COLOR
MOVE X,D0 ;MOVE X
ADD MVX,D0
CMP #0,D0
BLT FIXX
CMP #319,D0
BLE XOK
FIXX: ;FIX X (0 <= X <= 319)
NEG MVX
ADD MVX,D0
XOK:
MOVE D0,X
MOVE Y,D0 ;MOVE Y
ADD MVY,D0
CMP #0,D0
BLT FIXY
CMP #199,D0
BLE YOK
FIXY: ;FIX Y (0 <= Y <= 199)
NEG MVY
ADD MVY,D0
YOK:
MOVE D0,Y
MOVE X2,D0 ;MOVE X2
ADD MVX2,D0
CMP #0,D0
BLT FIXX2
CMP #319,D0
BLE X2OK
FIXX2: ;FIX X2 (0 <= X2 <= 319)
NEG MVX2
ADD MVX2,D0
X2OK:
MOVE D0,X2
MOVE Y2,D0 ;MOVE Y2
ADD MVY2,D0
CMP #0,D0
BLT FIXY2
CMP #199,D0
BLE Y2OK
FIXY2: ;FIX Y2 (0 <= Y2 <= 199)
NEG MVY2
ADD MVY2,D0
Y2OK:
MOVE D0,Y2
MOVE DLY,D0 ;PAUSE
DELAY: DBRA D0,DELAY
BRA AGAIN ;NEXT LINE!
DONE:
SETSCREEN REZ,-1,-1 ;RESTORE RESOLUTION
TERM
DATA
CLS DC.B 'E',0,0
BSS
REZ DS.W 1
X DS.W 1
MVX DS.W 1
Y DS.W 1
MVY DS.W 1
X2 DS.W 1
MVX2 DS.W 1
Y2 DS.W 1
MVY2 DS.W 1
SVA0 DS.L 1
LENGTH DS.W 1
DLY DS.W 1
END